In [1]:
from __future__ import print_function, division

In [2]:
# This changes the current directory to the base saga directory - make sure to run this first!
# This is necessary to be able to import the py files and use the right directories,
# while keeping all the notebooks in their own directory.
import os
import sys
from time import time

if 'saga_base_dir' not in locals():
    saga_base_dir = os.path.abspath('..')
if saga_base_dir not in sys.path:
    os.chdir(saga_base_dir)

In [3]:
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import rcParams

rcParams['figure.figsize'] = (16, 8)
rcParams['image.interpolation'] = 'none'
rcParams['image.origin'] = 'lower'

In [4]:
import urllib2
import datetime

import numpy  as np

from astropy import units as u
from astropy.coordinates import SkyCoord, AltAz, EarthLocation, get_sun
from astropy.time import Time
from astropy.utils.data import get_readable_fileobj
from astropy.io import fits
from astropy.table import Table, QTable, Column, MaskedColumn
from astropy import table

In [5]:
import cython
%load_ext cython

In [6]:
for module in ['hosts', 'targeting', 'aat']:
    if module in globals():
        reload(globals()[module])
    else:
        globals()[module] = __import__(module)
#g = targeting.get_gama() #re-caches the gama catalog

In [7]:
hsd = hosts.get_saga_hosts_from_google(clientsecretjsonorfn='client_secrets.json', useobservingsummary=False)
hsd = dict([(h.name, h) for h in hsd])


Using cached version of google hosts list from file "hosts_dl.pkl2"

In [8]:
def nmagy_flux_to_mag(flux):
    return (22.5 - 2.5*np.log10(flux).view(np.ma.masked_array))*u.mag

Search for the Bricks corresponding to SAGA hosts

This is because the DR3 data release is not yet out so Risa needs to download the bricks from her proporietary access.


In [8]:
#pure-python version
def find_all_bricks(scs_to_match, bricktab):
    """
    Find all the DECALS bricks that get all of the skycoords in ``scs_to_match``
    """
    inras = []
    indecs = []
    bricks_to_include = np.zeros(len(bricktab), dtype=bool)
    ra1 = bricktab['RA1']
    ra2 = bricktab['RA2']
    dec1 = bricktab['DEC1']
    dec2 = bricktab['DEC2']
    for ra, dec in zip(scs_to_match.ra.deg, scs_to_match.dec.deg):
        inra = (ra1 < ra) & (ra < ra2)
        indec = (dec1 < dec) & (dec < dec2)
        inbrick = inra&indec
        #assert np.sum(inbrick) == 1
        bricks_to_include[inbrick] = True
    return bricks_to_include

In [11]:
%%cython

cimport cython
import numpy as np

def find_all_bricks(scs_to_match, bricktab):
    """
    Find all the DECALS bricks that get all of the skycoords in ``scs_to_match``
    """
    bricks_to_include = np.zeros(len(bricktab), dtype=np.dtype("i"))
    ra1 = np.array(bricktab['RA1']).astype('float64')
    ra2 = np.array(bricktab['RA2']).astype('float64')
    dec1 = np.array(bricktab['DEC1']).astype('float64')
    dec2 = np.array(bricktab['DEC2']).astype('float64')
    _find_all_innerloop(bricks_to_include, 
                        scs_to_match.ra.deg, scs_to_match.dec.deg, 
                        ra1, ra2, dec1, dec2)
    return bricks_to_include.astype(bool)

@cython.boundscheck(False) # turn off bounds-checking for entire function
@cython.wraparound(False)  # turn off negative index wrapping for entire function
cdef void _find_all_innerloop(int[:] bricks_to_include, 
                              double[:]  ras, double[:]  decs, 
                              double[:]  ras1, double[:]  ras2, 
                              double[:]  decs1, double[:]  decs2):
    cdef size_t i, j
    cdef size_t ncoos = len(ras)
    cdef size_t nbricks = len(ras1)
    
    for i in range(ncoos):
        for j in range(nbricks):
            if ras1[j] < ras[i] < ras2[j] and decs1[j] < decs[i] < decs2[j]:
                bricks_to_include[j] = 1

In [12]:
def plot_bricks(bricktab):
    for brick in bricktab:
        ras = [brick['RA1'], brick['RA1'], brick['RA2'], brick['RA2'], brick['RA1']]
        decs = [brick['DEC1'], brick['DEC2'], brick['DEC2'], brick['DEC1'], brick['DEC1']]
        plt.plot(ras, decs)
        plt.text(brick['RA'], brick['DEC'], brick['BRICKNAME'], ha='center', va='center')

In [13]:
bricktab = Table.read('decals_catalogs/survey-bricks.fits.gz')

Script to copy the bricks

(From Risa:) for reference the names of the files we need to copy are:

/scratch1/scratchdirs/desiproc/dr3/tractor/BRICKNUM/tractor-BRICKNAME.fits

where BRICKNUM is the first 3 digits of BRICKNAME


In [12]:
fromtempl = '/scratch1/scratchdirs/desiproc/dr3/tractor/{bricknamef3}/tractor-{brickname}.fits'

def generate_risa_script_lines(bricks, finalfn_base, write_file=False):
    """
    Generates a script that risa can use to copy over the necessary bricks
    """
    lines = []
    fns = []
    for bricknm in bricks['BRICKNAME']:
        fromfn = fromtempl.format(brickname=bricknm, bricknamef3=bricknm[:3])
        fns.append(os.path.split(fromfn)[-1])
        lines.append('scp edison.nersc.gov:{} .'.format(fromfn))

    lines.append('tar -cf {}.tar '.format(finalfn_base))
    lines.append('gzip {}.tar'.format(finalfn_base))
    
    fn = None
    if write_file:
        if write_file is True:
            fn = finalfn_base + '_decals_dl.sh'
        else:
            fn = os.path.join(write_file, finalfn_base + '_decals_dl.sh')
            
        with open(fn, 'w') as f:
            for l in lines:
                f.write(l)
                f.write('\n')
    
    return lines, fn

Test w/ AnaK


In [14]:
anak = hsd['AnaK']
anakscs = SkyCoord(anak.get_sdss_catalog()['ra'], 
                   anak.get_sdss_catalog()['dec'], 
                   unit=u.deg)

In [15]:
scs_to_search = anakscs[::25]
scs_to_search = scs_to_search[np.random.permutation(len(scs_to_search))]
scs_to_search = anakscs

st = time()
anak_brick_msk = find_all_bricks(scs_to_search, bricktab)
et = time()
print(et-st, 's')

plt.scatter(anakscs.ra, anakscs.dec, alpha=.15, lw=0)
plot_bricks(bricktab[anak_brick_msk])


102.610782146 s

In [152]:
generate_risa_script_lines(bricktab[anak_brick_msk], 'anak-bricks', write_file=True)
!cat anak-bricks_decals_dl.sh


scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2478p187.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2481p187.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2483p187.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2474p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2476p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2479p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2482p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2484p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2487p190.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2472p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2475p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2477p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2480p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2483p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2485p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2488p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/249/tractor-2491p192.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2471p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2473p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2476p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2478p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2481p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2484p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2486p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2489p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/249/tractor-2492p195.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/246/tractor-2469p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2472p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2474p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2477p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2479p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2482p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2485p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2487p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/249/tractor-2490p197.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2470p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2473p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2475p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2478p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2480p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2483p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2486p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2488p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/249/tractor-2491p200.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2471p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2474p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2476p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2479p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2481p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2484p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2487p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2489p202.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2473p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2476p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2478p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2481p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2484p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2486p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2489p205.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2477p207.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/247/tractor-2479p207.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2482p207.fits .
scp edison.nersc.gov:/scratch1/scratchdirs/desiproc/dr3/tractor/248/tractor-2485p207.fits .
tar -cf anak-bricks.tar 
gzip anak-bricks.tar

Now try the whole shebang


In [22]:
named = 'Bandamanna, Dune, Gilgamesh, Odyssey, OBrother, AnaK, Catch22, Narnia'.split(', ')
nsas = [165082, 145398, 145729, 145879, 166141, 149977, 150578, 153017, 127226, 129237, 129387, 130133, 130625, 131531]

In [23]:
hostobjs = [hsd[nm] for nm in named]
for nsa in nsas:
    hostobjs.append(hosts.NSAHost(nsa))
    
for h in hostobjs:
    h.fnsdss = 'SAGADropbox/base_catalogs/base_sql_nsa{0}.fits.gz'.format(h.nsaid)
    h._cached_sdss = None

In [15]:
# make sure they can all load their catalogs
for ho in hostobjs:
    print(ho)
    cat = ho.get_sdss_catalog()


<hosts.NSAHost object w/ name 'Bandamanna' AKA: ['NGC7818', 'NSA126115']>
<hosts.NSAHost object w/ name 'Dune' AKA: ['NGC5750', 'NSA165536']>
<hosts.NSAHost object w/ name 'Gilgamesh' AKA: ['NGC5962', 'NSA166313']>
<hosts.NSAHost object w/ name 'Odyssey' AKA: ['NGC6181', 'NSA147100']>
<hosts.NSAHost object w/ name 'OBrother' AKA: ['NSA149781']>
<hosts.NSAHost object w/ name 'AnaK' AKA: ['NGC7716', 'NSA61945']>
<hosts.NSAHost object w/ name 'Catch22' AKA: ['NGC7541', 'NSA150887']>
<hosts.NSAHost object w/ name 'Narnia' AKA: ['NGC1015', 'NSA132339']>
<hosts.NSAHost object w/ name 'NSA165082'>
<hosts.NSAHost object w/ name 'NSA145398'>
<hosts.NSAHost object w/ name 'NSA145729'>
<hosts.NSAHost object w/ name 'NSA145879'>
<hosts.NSAHost object w/ name 'NSA166141'>
<hosts.NSAHost object w/ name 'NSA149977'>
<hosts.NSAHost object w/ name 'NSA150578'>
<hosts.NSAHost object w/ name 'NSA153017'>
<hosts.NSAHost object w/ name 'NSA127226'>
<hosts.NSAHost object w/ name 'NSA129237'>
<hosts.NSAHost object w/ name 'NSA129387'>
<hosts.NSAHost object w/ name 'NSA130133'>
<hosts.NSAHost object w/ name 'NSA130625'>
<hosts.NSAHost object w/ name 'NSA131531'>

In [47]:
for h in hostobjs:
    htab = h.get_sdss_catalog()
    scs = SkyCoord(htab['ra'], htab['dec'], unit=u.deg)

    st = time()
    brick_msk = find_all_bricks(scs, bricktab)
    et = time()
    print(h.name, et-st, 's')
    
    outfn = generate_risa_script_lines(bricktab[brick_msk], 
                                       '{}-bricks'.format(h.name), 
                                       write_file='decals_catalogs')[1]
    !cp $outfn /Users/erik/Dropbox/scripts_for_risa

    plt.figure()
    plt.scatter(scs.ra, scs.dec, alpha=.15, lw=0)
    plot_bricks(bricktab[brick_msk])
    plt.title(h.name)
    plt.savefig('/Users/erik/Dropbox/scripts_for_risa/{}.png'.format(h.name))


Bandamanna 62.9318871498 s
Dune 119.61194396 s
Gilgamesh 114.613766193 s
Odyssey 143.258332968 s
OBrother 105.579316854 s
AnaK 104.953556061 s
Catch22 90.9490599632 s
Narnia 81.522559166 s
NSA165082 88.5563349724 s
NSA145398 105.980362177 s
NSA145729 111.13717103 s
NSA145879 118.410391092 s
NSA166141 119.030681849 s
NSA149977 80.7785429955 s
NSA150578 77.1743168831 s
NSA153017 72.5930798054 s
NSA127226 66.6770560741 s
NSA129237 64.4723660946 s
NSA129387 77.6816520691 s
NSA130133 75.1966509819 s
NSA130625 74.5449619293 s
NSA131531 69.7502119541 s

Now load the catalogs for AnaK, again as a test case


In [16]:
anak = hsd['AnaK']

In [17]:
anakbrickfns = !tar tf decals_catalogs/AnaK-bricks.tgz
anakbrickfns = ['decals_catalogs/'+fn for fn in anakbrickfns]

In [19]:
allbricks = table.vstack([Table.read(fn) for fn in anakbrickfns])
decals_scs = SkyCoord(allbricks['ra'], allbricks['dec'])
allbricks


WARNING: UnitsWarning: '1/deg^2' did not parse as fits unit: Numeric factor not supported by FITS [astropy.units.core]
WARNING:astropy:UnitsWarning: '1/deg^2' did not parse as fits unit: Numeric factor not supported by FITS
WARNING: UnitsWarning: 'nanomaggy' did not parse as fits unit: At col 0, Unit 'nanomaggy' not supported by the FITS standard.  [astropy.units.core]
WARNING:astropy:UnitsWarning: 'nanomaggy' did not parse as fits unit: At col 0, Unit 'nanomaggy' not supported by the FITS standard. 
WARNING: UnitsWarning: '1/nanomaggy^2' did not parse as fits unit: Numeric factor not supported by FITS [astropy.units.core]
WARNING:astropy:UnitsWarning: '1/nanomaggy^2' did not parse as fits unit: Numeric factor not supported by FITS
WARNING: UnitsWarning: '1/arcsec^2' did not parse as fits unit: Numeric factor not supported by FITS [astropy.units.core]
WARNING:astropy:UnitsWarning: '1/arcsec^2' did not parse as fits unit: Numeric factor not supported by FITS
Out[19]:
<Table masked=True length=433961>
brickidbricknameobjidbrick_primaryblobninblobtycho2inblobtyperara_ivardecdec_ivarbxbybx0by0left_blobout_of_boundsdchisq [5]ebvcpu_sourcecpu_blobblob_widthblob_heightblob_npixblob_nimagesblob_totalpixdecam_flux [6]decam_flux_ivar [6]decam_apflux [6,8]decam_apflux_resid [6,8]decam_apflux_ivar [6,8]decam_mw_transmission [6]decam_nobs [6]decam_rchi2 [6]decam_fracflux [6]decam_fracmasked [6]decam_fracin [6]decam_anymask [6]decam_allmask [6]decam_psfsize [6]wise_flux [4]wise_flux_ivar [4]wise_mw_transmission [4]wise_nobs [4]wise_fracflux [4]wise_rchi2 [4]wise_lc_flux [2,5]wise_lc_flux_ivar [2,5]wise_lc_nobs [2,5]wise_lc_fracflux [2,5]wise_lc_rchi2 [2,5]wise_lc_mjd [2,5]fracDevfracDev_ivarshapeExp_rshapeExp_r_ivarshapeExp_e1shapeExp_e1_ivarshapeExp_e2shapeExp_e2_ivarshapeDev_rshapeDev_r_ivarshapeDev_e1shapeDev_e1_ivarshapeDev_e2shapeDev_e2_ivar
deg1/deg^2deg1/deg^2magnanomaggy1/nanomaggy^2nanomaggynanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2arcsec1/arcsec^2arcsec1/arcsec^2
int32str8int32boolint32int16boolstr4float64float32float64float32float32float32float32float32boolboolfloat32float32float32float32int16int16int32int16int32float32float32float32float32float32float32uint8float32float32float32float32int16int16float32float32float32float32int16float32float32float32float32int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32
3303403531m0020False01FalsePSF353.1726386372.57166e+09-0.3803680427322.24169e+091144.948.178481144.08.0FalseFalse48.5943 .. 0.00.03341153.9530.2429244901991570.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884318 .. 0.9677880 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.031.6792 .. -271.1220.877433 .. 1.38793e-050.994354 .. 0.9997239 .. 120.000720507 .. 0.2380984.70991 .. 0.1074432.8974 .. 16.80940.257182 .. 0.0066618811 .. 20.000669833 .. 0.002470622.01163 .. 0.83264555361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0021False11FalsePSF352.9946653473.86035e+09-0.3799102538414.20494e+093590.3314.4573590.014.0FalseFalse125.094 .. 0.00.03471911.051.1820263431343040.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.880073 .. 0.9665480 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.08.81579 .. -215.1780.92557 .. 1.31892e-050.994133 .. 0.99970940 .. 120.0706172 .. 0.3417624.5152 .. 0.087661410.5466 .. 9.51540.29204 .. 0.025985212 .. 60.0559476 .. 0.05293191.48004 .. 0.69224255361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0022False21FalsePSF353.0311334741.28092e+09-0.3802261365971.36762e+093089.2510.12313089.010.0FalseFalse43.4426 .. 0.00.0352531.251.3819192171429810.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.878346 .. 0.9660430 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.04.68299 .. -146.4410.850943 .. 1.37609e-050.994043 .. 0.99970537 .. 110.0146516 .. 1.207621.23233 .. 0.1200555.58462 .. 7.397120.259787 .. 0.017452811 .. 40.00932415 .. 0.05308130.587701 .. 0.42211755361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0023False31FalseSIMP353.0943461943.40962e+09-0.3799029692933.51006e+092220.6914.56992220.015.0FalseFalse180.778 .. 187.4620.03458028.738.97294364219119610.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.880523 .. 0.966680 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.09.2004 .. -160.1850.977422 .. 1.69062e-050.994157 .. 0.9997143 .. 130.00500292 .. 0.6956385.87379 .. 0.0765167.40873 .. 15.83850.310842 .. 0.012822813 .. 30.00506708 .. 0.007551492.52237 .. 0.77275955361.8 .. 57003.40.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3303403531m0024False42FalsePSF353.0083881233.04525e+09-0.3793642516113.27457e+093401.7721.96213401.022.0FalseFalse91.7212 .. 0.00.03494391.473.3733274771360890.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.879346 .. 0.9663350 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.03.16745 .. 218.3480.894145 .. 1.70986e-050.994096 .. 0.99970738 .. 122.2281 .. 0.3092971.7065 .. 0.107471.88489 .. -0.1303050.297897 .. 0.014327712 .. 43.85894 .. 88.78270.680226 .. 0.43503755361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0025False42FalsePSF353.0093717421.62109e+09-0.3797788881651.73859e+093388.2616.2653388.017.0FalseFalse49.1989 .. 0.00.03495921.53.3733274771360890.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.879296 .. 0.9663210 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.012.5868 .. -29.84910.912485 .. 1.63421e-050.994093 .. 0.99970738 .. 120.142765 .. 6.951671.40203 .. 0.096492312.9726 .. 18.12060.296125 .. 0.017732212 .. 40.0834562 .. 0.006261821.35443 .. 0.3578155361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0026False51FalsePSF353.2540665571.35019e+09-0.3796495942641.41563e+0926.097818.038926.019.0FalseFalse48.2428 .. 0.00.03346071.341.4721202401432320.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884158 .. 0.9677410 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.512662 .. -135.3480.888164 .. 1.67412e-050.994345 .. 0.9997240 .. 130.0241229 .. 0.1768630.694843 .. 0.228868-0.608133 .. 8.165660.293009 .. 0.006797812 .. 20.0174241 .. 0.002965770.965709 .. 1.0153855363.2 .. 57004.10.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0027False61FalseSIMP353.2330226728.38695e+08-0.3794958273888.43828e+08315.24620.1557315.019.0FalseFalse55.9572 .. 0.00.03328347.467.7130334861989910.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884735 .. 0.9679090 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.05.05522 .. 93.67530.880033 .. 1.73703e-050.994375 .. 0.99972139 .. 130.122366 .. 1.886181.08453 .. 0.1611813.42542 .. 6.403220.284713 .. 0.0063074512 .. 20.115054 .. 0.1756250.545771 .. 0.28000455363.2 .. 57004.10.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3303403531m0028False72FalsePSF353.1978138251.78169e+09-0.3782024241241.89099e+09799.02337.9328799.038.0FalseFalse33.7396 .. 0.00.0332551.123.723353901972340.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884827 .. 0.9679360 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.0-0.517814 .. -576.3130.892924 .. 1.73832e-050.99438 .. 0.99972139 .. 123.31409 .. 0.6868750.462957 .. 0.08570411.27372 .. 1.624660.293189 .. 0.0079670112 .. 21.18784 .. 5.021050.729491 .. 2.1230355363.2 .. 57004.10.00.00.00.00.00.00.00.00.00.00.00.00.00.0
.........................................................................................................................................................................................................
3361083551p0076109False39311FalsePSF355.167169.44541e+080.8788553351141.02933e+091220.273570.041220.03570.0FalseFalse29.6901 .. 0.00.03380340.350.391717145912370.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.883043 .. 0.9674160 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.06.54028 .. 230.1721.26045 .. 1.72773e-050.994288 .. 0.99971759 .. 120.141362 .. 0.8582890.845926 .. 0.1167026.47754 .. 0.00.289574 .. 0.012 .. 00.15158 .. 0.00.687656 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076110False39321FalsePSF355.0382482081.8835e+090.8793939085472.05344e+092991.373577.452992.03577.0FalseFalse65.3162 .. 0.00.03070180.560.632221272924010.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.893179 .. 0.9703610 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.013.0315 .. 123.241.22505 .. 1.8578e-050.99481 .. 0.99974356 .. 130.013375 .. 0.89316512.0497 .. 0.16018712.7326 .. 0.00.320024 .. 0.013 .. 00.0153083 .. 0.03.90111 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076111False39332FalseSIMP355.0468840211.78441e+090.8798540971731.85385e+092872.733583.772872.03584.0FalseFalse94.0101 .. 0.00.03077461.694.143732711962790.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.89294 .. 0.9702920 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.07.75372 .. -541.8191.19396 .. 1.59381e-050.994798 .. 0.99974257 .. 120.873587 .. 1.468531.02182 .. 0.050062810.6987 .. 0.00.286319 .. 0.012 .. 00.535797 .. 0.00.479079 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076112False39332FalseSIMP355.0474955211.2512e+090.8804268215031.32959e+092864.323591.642865.03591.0FalseFalse64.1743 .. 0.00.03078261.714.143732711962790.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.892914 .. 0.9702840 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.09.63127 .. 837.7991.13551 .. 1.37131e-050.994797 .. 0.99974257 .. 120.591262 .. 0.6499031.20879 .. 0.04456748.13158 .. 0.00.273983 .. 0.012 .. 00.963976 .. 0.00.397526 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076113False39342FalseSIMP355.1047628091.03932e+090.8809509572313.721e+082077.543598.832078.03598.0FalseFalse49.4817 .. 0.00.03190791.965.022627415935980.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.889224 .. 0.9692150 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.036.2427 .. -281.4030.846833 .. 1.23397e-050.994607 .. 0.99973358 .. 140.447494 .. 1.585387.63596 .. 0.043272138.5062 .. 0.00.224973 .. 0.014 .. 00.45961 .. 0.02.35944 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076114False39342FalseSIMP355.105092689.27665e+080.8797643673979.51093e+082073.03582.532072.03582.0FalseFalse35.3638 .. 41.24520.0318932.885.022627415935980.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.889273 .. 0.9692290 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.025.2848 .. 368.8371.193 .. 1.90896e-050.99461 .. 0.99973358 .. 140.65509 .. 0.5766119.70221 .. 0.061448927.6046 .. 0.00.33175 .. 0.014 .. 00.637267 .. 0.03.01954 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076115False39351FalsePSF355.1690878921.35421e+090.8798768580861.39943e+091193.783584.071194.03584.0FalseFalse34.724 .. 0.00.03390140.50.541919189814820.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.882725 .. 0.9673230 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.26853 .. -147.9721.24339 .. 1.54302e-050.994271 .. 0.99971659 .. 124.40535 .. 1.484451.12356 .. 0.0838479-1.89092 .. 0.00.272222 .. 0.012 .. 00.640154 .. 0.00.824653 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076116False39361FalsePSF355.1467257081.01037e+090.8803860219891.0822e+091501.013591.071501.03591.0FalseFalse27.5896 .. 0.00.03307430.380.421717145912860.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.885416 .. 0.9681070 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.0-1.10667 .. 5.712571.26073 .. 1.6034e-050.994411 .. 0.99972361 .. 140.131494 .. 16.50240.557563 .. 0.104245-1.81442 .. 0.00.331741 .. 0.014 .. 00.0802634 .. 0.00.193326 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076117False39371FalsePSF355.1140782132.68624e+090.880844599911.8398e+091949.553597.371949.03598.0FalseFalse75.8239 .. 0.00.032130.690.752212170914490.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.888498 .. 0.9690040 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.011.866 .. -204.5591.04361 .. 1.26271e-050.99457 .. 0.99973160 .. 140.00797494 .. 0.4967844.82468 .. 0.081236112.2341 .. 0.00.273172 .. 0.014 .. 00.00735216 .. 0.02.10503 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076118False39381FalseSIMP355.0410408795.4041e+080.8807225125024.65692e+082953.03595.72953.03596.0FalseFalse30.4873 .. 0.00.03073131.621.69171212099720.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.893082 .. 0.9703330 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.480515 .. -120.1770.978774 .. 1.29792e-050.994806 .. 0.99974256 .. 131.3484 .. 1.403691.96866 .. 0.05643610.479619 .. 0.00.258382 .. 0.013 .. 01.35662 .. 0.00.455682 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0

Checking out one specific object that seems to be a satellite from SDSS


In [79]:
seps = SkyCoord(353.77881, 0.30106, unit=u.deg).separation(decals_scs)
sorti = np.argsort(seps)
print(seps[sorti[:2]].to(u.arcsec))
allbricks[sorti[:2]]


[u'0.104814arcsec' u'4.17148arcsec']
Out[79]:
<Table masked=True length=2>
brickidbricknameobjidbrick_primaryblobninblobtycho2inblobtyperara_ivardecdec_ivarbxbybx0by0left_blobout_of_boundsdchisq [5]ebvcpu_sourcecpu_blobblob_widthblob_heightblob_npixblob_nimagesblob_totalpixdecam_flux [6]decam_flux_ivar [6]decam_apflux [6,8]decam_apflux_resid [6,8]decam_apflux_ivar [6,8]decam_mw_transmission [6]decam_nobs [6]decam_rchi2 [6]decam_fracflux [6]decam_fracmasked [6]decam_fracin [6]decam_anymask [6]decam_allmask [6]decam_psfsize [6]wise_flux [4]wise_flux_ivar [4]wise_mw_transmission [4]wise_nobs [4]wise_fracflux [4]wise_rchi2 [4]wise_lc_flux [2,5]wise_lc_flux_ivar [2,5]wise_lc_nobs [2,5]wise_lc_fracflux [2,5]wise_lc_rchi2 [2,5]wise_lc_mjd [2,5]fracDevfracDev_ivarshapeExp_rshapeExp_r_ivarshapeExp_e1shapeExp_e1_ivarshapeExp_e2shapeExp_e2_ivarshapeDev_rshapeDev_r_ivarshapeDev_e1shapeDev_e1_ivarshapeDev_e2shapeDev_e2_ivar
deg1/deg^2deg1/deg^2magnanomaggy1/nanomaggy^2nanomaggynanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2arcsec1/arcsec^2arcsec1/arcsec^2
int32str8int32boolint32int16boolstr4float64float32float64float32float32float32float32float32boolboolfloat32float32float32float32int16int16int32int16int32float32float32float32float32float32float32uint8float32float32float32float32int16int16float32float32float32float32int16float32float32float32float32int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32
3332233538p0024538True28694FalseSIMP353.778807611.66227e+110.3010890167861.70093e+113121.212501.493121.02501.0FalseFalse8463.38 .. 9266.50.030221413.0634.594967161818261380.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.894759 .. 0.9708180 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.06.7179 .. 770.150.905487 .. 1.58507e-050.994891 .. 0.99974743 .. 110.67702 .. 0.8263880.350426 .. 0.1892247.01547 .. 0.00.259451 .. 0.011 .. 00.891735 .. 0.00.553073 .. 0.055363.2 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3332233538p0024540True28694FalseSIMP353.7792347326.14233e+100.3021380986376.40055e+103115.342515.913115.02516.0FalseFalse3508.47 .. 3693.960.030243211.3534.594967161818261380.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.894687 .. 0.9707970 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.08.22394 .. -71.31940.919441 .. 1.59772e-050.994888 .. 0.99974743 .. 110.44364 .. 10.81140.327624 .. 0.17446211.7005 .. 0.00.258491 .. 0.011 .. 00.390014 .. 0.00.45889 .. 0.055363.2 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0

In [87]:
22.5 - 2.5*np.log10(allbricks[sorti[:2]]['decam_flux']).view(np.ma.masked_array)


-c:1: RuntimeWarning: divide by zero encountered in log10
Out[87]:
masked_BaseColumn(data =
 [[-- 22.659645080566406 21.449073791503906 -- 20.747966766357422 --]
 [-- 22.798818588256836 22.152584075927734 -- 21.067115783691406 --]],
                  mask =
 [[ True False False  True False  True]
 [ True False False  True False  True]],
            fill_value = 1.0)

More general comparisons with SDSS


In [24]:
sdsscat = anak.get_sdss_catalog()
sdss_scs = SkyCoord(sdsscat['RA'], sdsscat['DEC'], unit=u.deg)

In [25]:
idx, d2d, _ = sdss_scs.match_to_catalog_sky(decals_scs)

In [26]:
plt.hist(d2d.arcsec,bins=1000, range=(0,2), histtype='step')
plt.tight_layout()



In [27]:
# this is a bit conservative, but purity>completeness
matches = d2d < 0.3*u.arcsec

matched_sdss = sdsscat[matches]
matched_decals = allbricks[idx[matches]]

matched_decals_mags = nmagy_flux_to_mag(matched_decals['decam_flux'])
matched_decals_g = matched_decals_mags[:,1]
matched_decals_r = matched_decals_mags[:,2]
matched_decals_z = matched_decals_mags[:,4]


-c:2: RuntimeWarning: divide by zero encountered in log10
-c:2: RuntimeWarning: invalid value encountered in log10

In [28]:
dg = matched_sdss['g']*u.mag - matched_decals_g
dr = matched_sdss['r']*u.mag - matched_decals_r
dz = matched_sdss['z']*u.mag - matched_decals_z

sckwargs = dict(lw=0, s=3, alpha=.05)
plt.scatter(matched_decals_r, dg, c='g', **sckwargs)
plt.scatter(matched_decals_r, dr, c='r',**sckwargs)
plt.scatter(matched_decals_r, dz, c='k', **sckwargs)

plt.axhline(0, color='k', ls=':')

plt.axhline(0.05, color='r', ls=':')

plt.xlim(12,24)
plt.ylim(-1, 1)
plt.xlabel('DECALS r')
plt.ylabel('SDSS-DECALS')


Out[28]:
<matplotlib.text.Text at 0x1332f1690>

Specific comparisons of "bad" objects from SDSS

Here are the P_ML > 0.1 objects in AnaK. These are sorted on zquality: the first two objects have not been targeted (zq=-1), the next 4 objects were targted but did not measure a redshift (zq=1). Note that these all have r_err > 0.1.

I suggest putting this list into SDSS Navigate to give you a better sense of these failures.


In [208]:
data = """
    r_err                 RA                   Dec          r_mag    zquality

    0.100777       353.94856      0.38954233      17.7467   -1
    0.0699525       354.00201     0.084751088      17.0503   -1
     0.126755       354.08257     0.060601196      17.8210   1
     0.138982       354.07164     0.039664411      17.8468   1
     0.211444       353.78034     0.016203257      20.3697   1
     0.119890       354.14926      0.32713565      17.7556   1
    0.0251430       354.01042      0.56803290      17.5909   4
    0.0117326       354.19523      0.62342377      15.7093   4
   0.00874042       353.98570      0.70387257      16.1683   4
   0.00154292       354.13105      0.29726505      11.3966   4
   """[1:-1]
failures_tab = Table.read(data, format='ascii')

In [194]:
print(targeting.sampled_imagelist(failures_tab['RA'], failures_tab['Dec']))
# can also be used for Yao's viewer at http://www.slac.stanford.edu/~yymao/saga/image-list-tool/


name ra dec
0 353.94856 0.38954233
1 354.00201 0.084751088
2 354.08257 0.060601196
3 354.07164 0.039664411
4 353.78034 0.016203257
5 354.14926 0.32713565
6 354.01042 0.5680329
7 354.19523 0.62342377
8 353.9857 0.70387257
9 354.13105 0.29726505

In [209]:
failures_sc = SkyCoord(failures_tab['RA'], failures_tab['Dec'], unit=u.deg)

In [210]:
idx_sdss, d2d_sdss, _ = failures_sc.match_to_catalog_sky(sdss_scs)
failures_tab['SDSS_offset'] = d2d_sdss.to(u.arcsec)
d2d_sdss.arcsec


Out[210]:
array([ 0.00458799,  0.0014929 ,  0.01257544,  0.00988546,  0.0074604 ,
        0.01422832,  0.014211  ,  0.00094877,  0.00067798,  0.01450821])

In [211]:
idx_decals, d2d_decals, _ = failures_sc.match_to_catalog_sky(decals_scs)
failures_tab['DECALS_offset'] = d2d_decals.to(u.arcsec)
d2d_decals.arcsec


Out[211]:
array([ 0.1973395 ,  0.13132402,  0.18287091,  0.66298091,  5.99867319,
        0.12780086,  0.78696739,  0.52710998,  0.14172156,  0.4706275 ])

Curiosly, the DECALS matches tend to have centroids quite a bit off


In [212]:
decals_mags = nmagy_flux_to_mag(allbricks[idx_decals]['decam_flux'])

failures_tab['DECALS_g'] = decals_mags[:, 1]
failures_tab['SDSS_g'] = sdsscat[idx_sdss]['g']*u.mag
failures_tab['dg'] = failures_tab['SDSS_g'] - failures_tab['DECALS_g']

failures_tab['DECALS_r'] = decals_mags[:, 2]
failures_tab['SDSS_r'] = sdsscat[idx_sdss]['r']*u.mag
failures_tab['dr'] = failures_tab['SDSS_r'] - failures_tab['DECALS_r']

failures_tab['DECALS_z'] = decals_mags[:, 4]
failures_tab['SDSS_z'] = sdsscat[idx_sdss]['z']*u.mag
failures_tab['dz'] = failures_tab['SDSS_z'] - failures_tab['DECALS_z']

failures_tab


-c:2: RuntimeWarning: divide by zero encountered in log10
Out[212]:
<Table length=10>
r_errRADecr_magzqualitySDSS_offsetDECALS_offsetDECALS_gSDSS_gdgDECALS_rSDSS_rdrDECALS_zSDSS_zdz
arcsecarcsecmagmagmagmagmagmagmagmagmag
float64float64float64float64int64float64float64float32float32float32float32float32float32float32float32float32
0.100777353.948560.3895423317.7467-10.004587992441050.19733950061724.071819.8384-4.233422.835217.7467-5.0885222.252517.0633-5.18915
0.0699525354.002010.08475108817.0503-10.001492896105820.13132402186522.523620.0711-2.4524822.472217.0503-5.4218622.517717.5281-4.98959
0.126755354.082570.06060119617.82110.01257543821630.18287091167923.161418.065-5.0963522.326917.821-4.5058721.340417.6484-3.69201
0.138982354.071640.03966441117.846810.009885462405330.66298091098822.922718.8576-4.0650521.862217.8468-4.0154320.950617.2359-3.71471
0.211444353.780340.01620325720.369710.007460397339985.9986731914723.104821.0776-2.027222.126620.3697-1.7568221.632326.50844.87614
0.11989354.149260.3271356517.755610.01422832071680.12780085715822.249517.5877-4.6617921.731717.7556-3.9760721.453616.6073-4.84629
0.025143354.010420.568032917.590940.0142110012040.7869673922918.341818.0046-0.3371617.851217.5909-0.26024217.527917.2869-0.241018
0.0117326354.195230.6234237715.709340.0009487693652030.52710997854319.634616.1591-3.4754719.552315.7093-3.8430619.597615.3143-4.28331
0.00874042353.98570.7038725716.168340.0006779806387270.14172156069318.290916.5771-1.7138217.839916.1683-1.6715717.548215.8416-1.70654
0.00154292354.131050.2972650511.396640.01450821486130.4706275047115.289412.2354-3.0539714.644411.3966-3.2478613.482810.6397-2.84312

Q from Risa: are there objects in DECALS r < 21 that are not in the SDSS catalog?


In [30]:
allbricks[']


Out[30]:
<Table masked=True length=433961>
brickidbricknameobjidbrick_primaryblobninblobtycho2inblobtyperara_ivardecdec_ivarbxbybx0by0left_blobout_of_boundsdchisq [5]ebvcpu_sourcecpu_blobblob_widthblob_heightblob_npixblob_nimagesblob_totalpixdecam_flux [6]decam_flux_ivar [6]decam_apflux [6,8]decam_apflux_resid [6,8]decam_apflux_ivar [6,8]decam_mw_transmission [6]decam_nobs [6]decam_rchi2 [6]decam_fracflux [6]decam_fracmasked [6]decam_fracin [6]decam_anymask [6]decam_allmask [6]decam_psfsize [6]wise_flux [4]wise_flux_ivar [4]wise_mw_transmission [4]wise_nobs [4]wise_fracflux [4]wise_rchi2 [4]wise_lc_flux [2,5]wise_lc_flux_ivar [2,5]wise_lc_nobs [2,5]wise_lc_fracflux [2,5]wise_lc_rchi2 [2,5]wise_lc_mjd [2,5]fracDevfracDev_ivarshapeExp_rshapeExp_r_ivarshapeExp_e1shapeExp_e1_ivarshapeExp_e2shapeExp_e2_ivarshapeDev_rshapeDev_r_ivarshapeDev_e1shapeDev_e1_ivarshapeDev_e2shapeDev_e2_ivar
deg1/deg^2deg1/deg^2magnanomaggy1/nanomaggy^2nanomaggynanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2nanomaggy1/nanomaggy^2arcsec1/arcsec^2arcsec1/arcsec^2
int32str8int32boolint32int16boolstr4float64float32float64float32float32float32float32float32boolboolfloat32float32float32float32int16int16int32int16int32float32float32float32float32float32float32uint8float32float32float32float32int16int16float32float32float32float32int16float32float32float32float32int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32
3303403531m0020False01FalsePSF353.1726386372.57166e+09-0.3803680427322.24169e+091144.948.178481144.08.0FalseFalse48.5943 .. 0.00.03341153.9530.2429244901991570.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884318 .. 0.9677880 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.031.6792 .. -271.1220.877433 .. 1.38793e-050.994354 .. 0.9997239 .. 120.000720507 .. 0.2380984.70991 .. 0.1074432.8974 .. 16.80940.257182 .. 0.0066618811 .. 20.000669833 .. 0.002470622.01163 .. 0.83264555361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0021False11FalsePSF352.9946653473.86035e+09-0.3799102538414.20494e+093590.3314.4573590.014.0FalseFalse125.094 .. 0.00.03471911.051.1820263431343040.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.880073 .. 0.9665480 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.08.81579 .. -215.1780.92557 .. 1.31892e-050.994133 .. 0.99970940 .. 120.0706172 .. 0.3417624.5152 .. 0.087661410.5466 .. 9.51540.29204 .. 0.025985212 .. 60.0559476 .. 0.05293191.48004 .. 0.69224255361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0022False21FalsePSF353.0311334741.28092e+09-0.3802261365971.36762e+093089.2510.12313089.010.0FalseFalse43.4426 .. 0.00.0352531.251.3819192171429810.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.878346 .. 0.9660430 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.04.68299 .. -146.4410.850943 .. 1.37609e-050.994043 .. 0.99970537 .. 110.0146516 .. 1.207621.23233 .. 0.1200555.58462 .. 7.397120.259787 .. 0.017452811 .. 40.00932415 .. 0.05308130.587701 .. 0.42211755361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0023False31FalseSIMP353.0943461943.40962e+09-0.3799029692933.51006e+092220.6914.56992220.015.0FalseFalse180.778 .. 187.4620.03458028.738.97294364219119610.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.880523 .. 0.966680 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.09.2004 .. -160.1850.977422 .. 1.69062e-050.994157 .. 0.9997143 .. 130.00500292 .. 0.6956385.87379 .. 0.0765167.40873 .. 15.83850.310842 .. 0.012822813 .. 30.00506708 .. 0.007551492.52237 .. 0.77275955361.8 .. 57003.40.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3303403531m0024False42FalsePSF353.0083881233.04525e+09-0.3793642516113.27457e+093401.7721.96213401.022.0FalseFalse91.7212 .. 0.00.03494391.473.3733274771360890.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.879346 .. 0.9663350 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.03.16745 .. 218.3480.894145 .. 1.70986e-050.994096 .. 0.99970738 .. 122.2281 .. 0.3092971.7065 .. 0.107471.88489 .. -0.1303050.297897 .. 0.014327712 .. 43.85894 .. 88.78270.680226 .. 0.43503755361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0025False42FalsePSF353.0093717421.62109e+09-0.3797788881651.73859e+093388.2616.2653388.017.0FalseFalse49.1989 .. 0.00.03495921.53.3733274771360890.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.879296 .. 0.9663210 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.012.5868 .. -29.84910.912485 .. 1.63421e-050.994093 .. 0.99970738 .. 120.142765 .. 6.951671.40203 .. 0.096492312.9726 .. 18.12060.296125 .. 0.017732212 .. 40.0834562 .. 0.006261821.35443 .. 0.3578155361.8 .. 57003.40.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0026False51FalsePSF353.2540665571.35019e+09-0.3796495942641.41563e+0926.097818.038926.019.0FalseFalse48.2428 .. 0.00.03346071.341.4721202401432320.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884158 .. 0.9677410 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.512662 .. -135.3480.888164 .. 1.67412e-050.994345 .. 0.9997240 .. 130.0241229 .. 0.1768630.694843 .. 0.228868-0.608133 .. 8.165660.293009 .. 0.006797812 .. 20.0174241 .. 0.002965770.965709 .. 1.0153855363.2 .. 57004.10.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3303403531m0027False61FalseSIMP353.2330226728.38695e+08-0.3794958273888.43828e+08315.24620.1557315.019.0FalseFalse55.9572 .. 0.00.03328347.467.7130334861989910.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884735 .. 0.9679090 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.05.05522 .. 93.67530.880033 .. 1.73703e-050.994375 .. 0.99972139 .. 130.122366 .. 1.886181.08453 .. 0.1611813.42542 .. 6.403220.284713 .. 0.0063074512 .. 20.115054 .. 0.1756250.545771 .. 0.28000455363.2 .. 57004.10.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3303403531m0028False72FalsePSF353.1978138251.78169e+09-0.3782024241241.89099e+09799.02337.9328799.038.0FalseFalse33.7396 .. 0.00.0332551.123.723353901972340.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.884827 .. 0.9679360 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.0-0.517814 .. -576.3130.892924 .. 1.73832e-050.99438 .. 0.99972139 .. 123.31409 .. 0.6868750.462957 .. 0.08570411.27372 .. 1.624660.293189 .. 0.0079670112 .. 21.18784 .. 5.021050.729491 .. 2.1230355363.2 .. 57004.10.00.00.00.00.00.00.00.00.00.00.00.00.00.0
.........................................................................................................................................................................................................
3361083551p0076109False39311FalsePSF355.167169.44541e+080.8788553351141.02933e+091220.273570.041220.03570.0FalseFalse29.6901 .. 0.00.03380340.350.391717145912370.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.883043 .. 0.9674160 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.06.54028 .. 230.1721.26045 .. 1.72773e-050.994288 .. 0.99971759 .. 120.141362 .. 0.8582890.845926 .. 0.1167026.47754 .. 0.00.289574 .. 0.012 .. 00.15158 .. 0.00.687656 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076110False39321FalsePSF355.0382482081.8835e+090.8793939085472.05344e+092991.373577.452992.03577.0FalseFalse65.3162 .. 0.00.03070180.560.632221272924010.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.893179 .. 0.9703610 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.013.0315 .. 123.241.22505 .. 1.8578e-050.99481 .. 0.99974356 .. 130.013375 .. 0.89316512.0497 .. 0.16018712.7326 .. 0.00.320024 .. 0.013 .. 00.0153083 .. 0.03.90111 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076111False39332FalseSIMP355.0468840211.78441e+090.8798540971731.85385e+092872.733583.772872.03584.0FalseFalse94.0101 .. 0.00.03077461.694.143732711962790.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.89294 .. 0.9702920 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.07.75372 .. -541.8191.19396 .. 1.59381e-050.994798 .. 0.99974257 .. 120.873587 .. 1.468531.02182 .. 0.050062810.6987 .. 0.00.286319 .. 0.012 .. 00.535797 .. 0.00.479079 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076112False39332FalseSIMP355.0474955211.2512e+090.8804268215031.32959e+092864.323591.642865.03591.0FalseFalse64.1743 .. 0.00.03078261.714.143732711962790.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.892914 .. 0.9702840 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.09.63127 .. 837.7991.13551 .. 1.37131e-050.994797 .. 0.99974257 .. 120.591262 .. 0.6499031.20879 .. 0.04456748.13158 .. 0.00.273983 .. 0.012 .. 00.963976 .. 0.00.397526 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076113False39342FalseSIMP355.1047628091.03932e+090.8809509572313.721e+082077.543598.832078.03598.0FalseFalse49.4817 .. 0.00.03190791.965.022627415935980.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.889224 .. 0.9692150 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.036.2427 .. -281.4030.846833 .. 1.23397e-050.994607 .. 0.99973358 .. 140.447494 .. 1.585387.63596 .. 0.043272138.5062 .. 0.00.224973 .. 0.014 .. 00.45961 .. 0.02.35944 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076114False39342FalseSIMP355.105092689.27665e+080.8797643673979.51093e+082073.03582.532072.03582.0FalseFalse35.3638 .. 41.24520.0318932.885.022627415935980.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.889273 .. 0.9692290 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.025.2848 .. 368.8371.193 .. 1.90896e-050.99461 .. 0.99973358 .. 140.65509 .. 0.5766119.70221 .. 0.061448927.6046 .. 0.00.33175 .. 0.014 .. 00.637267 .. 0.03.01954 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0
3361083551p0076115False39351FalsePSF355.1690878921.35421e+090.8798768580861.39943e+091193.783584.071194.03584.0FalseFalse34.724 .. 0.00.03390140.50.541919189814820.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.882725 .. 0.9673230 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.26853 .. -147.9721.24339 .. 1.54302e-050.994271 .. 0.99971659 .. 124.40535 .. 1.484451.12356 .. 0.0838479-1.89092 .. 0.00.272222 .. 0.012 .. 00.640154 .. 0.00.824653 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076116False39361FalsePSF355.1467257081.01037e+090.8803860219891.0822e+091501.013591.071501.03591.0FalseFalse27.5896 .. 0.00.03307430.380.421717145912860.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.885416 .. 0.9681070 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.0-1.10667 .. 5.712571.26073 .. 1.6034e-050.994411 .. 0.99972361 .. 140.131494 .. 16.50240.557563 .. 0.104245-1.81442 .. 0.00.331741 .. 0.014 .. 00.0802634 .. 0.00.193326 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076117False39371FalsePSF355.1140782132.68624e+090.880844599911.8398e+091949.553597.371949.03598.0FalseFalse75.8239 .. 0.00.032130.690.752212170914490.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.888498 .. 0.9690040 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.011.866 .. -204.5591.04361 .. 1.26271e-050.99457 .. 0.99973160 .. 140.00797494 .. 0.4967844.82468 .. 0.081236112.2341 .. 0.00.273172 .. 0.014 .. 00.00735216 .. 0.02.10503 .. 0.055365.0 .. 0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
3361083551p0076118False39381FalseSIMP355.0410408795.4041e+080.8807225125024.65692e+082953.03595.72953.03596.0FalseFalse30.4873 .. 0.00.03073131.621.69171212099720.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00.893082 .. 0.9703330 .. 00.0 .. 0.00.0 .. 0.00.0 .. 0.00.0 .. 0.00 .. 00 .. 00.0 .. 0.00.480515 .. -120.1770.978774 .. 1.29792e-050.994806 .. 0.99974256 .. 131.3484 .. 1.403691.96866 .. 0.05643610.479619 .. 0.00.258382 .. 0.013 .. 01.35662 .. 0.00.455682 .. 0.055365.0 .. 0.00.00.00.450.450.00.00.00.00.00.00.00.00.00.0

In [118]:
decals_r = nmagy_flux_to_mag(allbricks['decam_flux'])[:,2]
bright_decals_scs = decals_scs[(0*u.mag<decals_r)&(decals_r<21*u.mag)&(decals_scs.separation(anak.coords)<60*u.arcmin)]
idx, d2d, _ = bright_decals_scs.match_to_catalog_sky(sdss_scs)

plt.hist(d2d.arcsec, bins=100, range=(0, 30), histtype='step',log=True)
for ll in (0.5, 2, 20):
    plt.axvline(ll, c='k')
plt.tight_layout()


-c:2: RuntimeWarning: divide by zero encountered in log10
-c:2: RuntimeWarning: invalid value encountered in log10

In [119]:
farish = (2*u.arcsec<d2d)&(d2d<20*u.arcsec)
vfar = d2d>20*u.arcsec
marginal = (0.5*u.arcsec<d2d)&(d2d<1.5*u.arcsec)

Iterated on the lists shown below a number of times to get a feel for what the represent: Pasted them into http://www.slac.stanford.edu/~yymao/saga/image-list-tool/ at a fairly high zoom and switched between SDSS and DECALS to see what the source of the differences might be.


In [123]:
print(targeting.sampled_imagelist(bright_decals_scs[farish], None, n=25,url=None, copytoclipboard=True, 
                                  names=d2d.arcsec[farish]))


name ra dec
2.30161450103 353.491102546 0.874160609341
6.21946377529 353.172583633 0.575601209242
9.91635326841 355.020586887 0.39993708565
4.26615706998 353.391672641 0.37895445281
9.82737165673 353.539526737 0.548123975308
13.7898325019 354.769412951 0.51994751909
6.82728727027 354.539979294 -0.551472888398
12.7152909483 354.116382311 0.282222864578
2.90463780738 353.954440824 0.444902620094
5.06858900003 354.344375107 0.593800861769
7.1583746599 353.234043702 0.725294929607
5.45038516504 354.5052403 1.16909173255
3.35882080228 355.022802819 -0.0281663278528
2.42512162733 354.388481277 -0.481867354295
4.5237786908 353.253409908 -0.129496608167
4.52185634623 353.654368519 0.00768915391056
14.8182247438 354.58714316 0.774985166148
10.8143759089 353.990203138 -0.595423432235
4.17211770156 354.597347737 0.403967791281
7.55470750764 354.041719933 -0.562671621798
10.1703588432 354.842814045 0.211083934203
4.54941210345 353.777952704 1.07909751287
2.1076777523 354.606379782 0.651101042865
14.8391433432 353.874843594 1.25268859972
7.50045458768 354.844445601 -0.02746488785

Mostly bright stars or extended objects, although one looks like a genuine low SB glx (http://skyserver.sdss.org/dr12/en/tools/chart/navi.aspx?ra=353.72474372&dec=1.21141596924)... but it's in SDSS, just has quite a different centroid


In [125]:
print(targeting.sampled_imagelist(bright_decals_scs[marginal], None, n=25,url=None, copytoclipboard=True, 
                                  names=d2d.arcsec[marginal]))


name ra dec
0.79936446872 354.836578762 0.934570640054
0.769990203959 354.389000649 0.625357215494
0.691269935823 354.130350017 -0.495459422135
0.564453126227 354.485250153 1.01297668524
0.503279544551 353.641281561 1.0278879111
0.641040246915 354.416204223 1.15277085319
1.37094229202 353.500961062 0.216928313803
0.509019589488 353.251538809 0.0969200718412
0.995858981376 354.129385284 -0.472434249893
0.634758672239 354.295338702 0.62887914601
0.566487687806 353.421043747 0.725679677589
0.614486910072 353.671357348 -0.278884731896
0.678885266805 353.591432557 0.429754055383
0.555324690054 354.690092234 0.414133339952
1.01682381446 354.223838624 0.829580897795
0.593878321914 354.225502035 -0.121209510249
1.06543788419 353.910880556 1.20536854811
0.719215070265 354.151281316 0.706315497747
1.07669235786 354.50993829 -0.296739125537
0.579744643023 354.195346454 0.330662218238
0.647505874397 354.208983879 0.242816461921
0.958336659465 353.594195303 0.761417718103
0.750463810195 353.771325318 0.473927804803
0.737211700328 353.331734536 0.0220256161491
0.970558623307 353.805325125 0.0373624999756

Mainly diffuse things with centroiding troubles


In [126]:
print(targeting.sampled_imagelist(bright_decals_scs.ra[vfar], bright_decals_scs.dec[vfar], n=25,url=None, copytoclipboard=True, 
                                  names=d2d.arcsec[vfar]), n=1000)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-126-df7247738bf3> in <module>()
      1 print(targeting.sampled_imagelist(bright_decals_scs.ra[vfar], bright_decals_scs.dec[vfar], n=25,url=None, copytoclipboard=True, 
----> 2                                   names=d2d.arcsec[vfar]), n=1000)

TypeError: 'n' is an invalid keyword argument for this function

Artifacts